Odoo / UI / *Add New field to existing module
New field to existing module
-
Step 1:
Task is to add new fields joining_date and salary
1. _mainfest.py
1. add depends module
2. add view xml
'depends' : ['hr', 'account'], 'data': [ 'views/hr_employee_views.xml' ], 2. model
1. add '_inherit'
2. add new field
class HrEmployee(models.Model): _inherit = 'hr.employee' joining_date = fields.Date('Joining Date') 3. view
1. add id
2. add name
3. add model
4. add inherit_id
5. add new fields
custom.employee.form.view hr.employee